<template>
  <div>
<h1 align="center">显示页面</h1>
<table class="table table-bordered">
  <tr>
    <td>用户编号</td>
    <td>用户账号</td>
    <td>用户密码</td>
    <td>注册时间</td>
    <td>用户类型</td>
  </tr>
  <tr v-for="item in list">
    <td>{{item.Uid}}</td>
    <td>{{item.ZhangHao}}</td>
    <td>{{item.MiMa}}</td>
    <td>{{item.UserDate.substr(0,10)+" "+item.UserDate.substr(11,20)}}</td>
    <td>{{item.UserType?"管理员":"普通用户"}}</td>
  </tr>
</table>
  </div>
</template>

<script setup lang="ts">
import {reactive,toRefs,onMounted} from 'vue'
import axios from 'axios'
import {useRoute,useRouter} from 'vue-router'
import moment  from 'moment';
const route=useRoute()
const router=useRouter()

let data:any=reactive({
  list:[],
  state:{

  }
})

let {list,state}=toRefs(data)

onMounted(()=>{
  show();
})

const show=()=>{
  axios({
    url:'/api/User/GetUserShow',
    method:'get',
    params:state.value
  })
  .then(res=>{
    console.log(res.data);
    list.value=res.data.data;
    console.log(res.data.data.length);
  })
  .catch(err=>{
    console.log(err)
  })
}
</script>

<style scoped>

</style>